import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart';

class SizeConverter implements JsonConverter<Size, List<dynamic>> {
  const SizeConverter();

  @override
  Size fromJson(List<dynamic> json) => Size(json[0], json[1]);

  @override
  List<double> toJson(Size object) => [object.width, object.height];
}